package com.we.wecc.us.api.controller;

import com.we.wecc.us.db.model.ActUser;
import com.we.wecc.us.db.model.User;
import com.we.wecc.us.mid.service.ActUserService;
import com.x.share.api.controller.BaseController;
import com.x.share.mid.exception.HelperException;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/actUser/")
public class ActUserController extends BaseController {

    @Resource
    ActUserService actUserService;

    @ApiOperation(value = "获取次数", notes= "获取次数", response = ActUser.class)
    @RequestMapping(value = "/getActUser", method = { RequestMethod.GET})
    public @ResponseBody Map<String, Object> getActUser(
            @ApiParam(value = "用户id") @RequestParam("userId") Long userId,
            @ApiParam(value = "应用id") @RequestHeader("appId") String appId,
            @ApiParam(value = "应用accessToken") @RequestHeader("atk") String atk) throws HelperException {
        ActUser au = actUserService.getActUser(userId);
        return success(au);
    }
}
